var WxParse = require('../../wxParse/wxParse.js');
Page({
    data: {
        bannerSwiperConfig: getApp().globalData.bannerSwiperConfig,
        serviceList: [
            {
                icon:"http://www.gzyueyun.com/m/yueyun-mini-app/assets/img/service_icon_01.png",
                title:"移动APP定制开发"
            },
            {
                icon:"http://www.gzyueyun.com/m/yueyun-mini-app/assets/img/service_icon_02.png",
                title:"网站定制开发"
            },
            {
                icon:"http://www.gzyueyun.com/m/yueyun-mini-app/assets/img/service_icon_03.png",
                title:"微信定制开发"
            },
            {
                icon:"http://www.gzyueyun.com/m/yueyun-mini-app/assets/img/service_icon_04.png",
                title:"O2O定制开发"
            },
            {
                icon:"http://www.gzyueyun.com/m/yueyun-mini-app/assets/img/service_icon_05.png",
                title:"物联网软件开发"
            },
            {
                icon:"http://www.gzyueyun.com/m/yueyun-mini-app/assets/img/service_icon_06.png",
                title:"云服务"
            }
        ],
        flowProcessList: ["需求评估","视觉设计","程序开发","测试上线"]
    },
    onLoad: function () {
        var that = this;
        wx.request({
          url: getApp().globalData.url+'/api/Index/index',
          method: 'post',
          data: {
            appid: 'wx31c714fb597f31a7'
          },
          header: {
            'Content-Type': 'application/x-www-form-urlencoded'
          },
          success: function (res) {
            // 联系我们的数据存储 start
            var contactusinfo = {};
             contactusinfo['address'] = res.data.content.address;
             contactusinfo['phone'] = res.data.content.phone;
             contactusinfo['email'] = res.data.content.email;
             contactusinfo['work_time'] = res.data.content.work_time;
             wx.setStorageSync('contactusinfo', contactusinfo);
             // 联系我们的数据存储 end
             // 轮播图的数据存储 start
            var lbt = res.data.lunbotu;
            lbt.forEach((item) =>{
                getApp().globalData.bannerSwiperConfig.imgUrls.push(item.photo);
            })
            that.setData({
                bannerSwiperConfig: getApp().globalData.bannerSwiperConfig
            })
             // 轮播图的数据存储 end
             // 案例展示的数据存储 start
            getApp().globalData.anlidata = res.data.content.incloud;
            // 首页的数据的存储 start
            var content = res.data.content.content;         
            var article = content;
             WxParse.wxParse('article', 'html', article, that, 5);
            // 首页的数据的存储 end
            // console.log(getApp().globalData.bannerSwiperConfig.imgUrls);
            
          }
        })
    }
});